<?php
header("Content-Type: text/html;charset=utf-8");
function table($tablename,$s1,$s2){
	$str_table=" ";
	$str_table.="<table align='center' border='1' width='600'>";
	$str_table.= "<caption><h1>$tablename</h1></caption>";

	for($out=0;$out<$s1;$out++){
		$bgcolor=$out%2==0?"#FFFFFF":"#DDDDDD";
		echo "<tr bdcolor=".$bgcolor.">";
		for($in=0;$in<$s2;$in++){
			$str_table.="<td>".($out*$s1+$in)."</td>";
		}
		$str_table.="</tr>";
	}
	$str_table.="</table>";
	return $str_table;
}
$str=table("第一个三行四列的表",3,4);
echo $str;
?>
